/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.trainee.aplikasipenjualan.ui.tapestry.controller;

import org.apache.tapestry.html.BasePage;
import org.apache.tapestry.record.PropertyChangeObserver;
import com.javaforge.tapestry.spring.annotations.InjectSpring;
import com.trainee.aplikasipenjualan.entity.Barang;

import com.trainee.aplikasipenjualan.service.AplikasipenjualanService;

/**
 *
 * @author BangsJack
 */
public abstract class BarangController extends BasePage {

    private Barang barang = new Barang();
    
    @InjectSpring("AplikasipenjualanService")
    public abstract AplikasipenjualanService getAplikasipenjualanService();

    public void simpan() {
        getAplikasipenjualanService().saveBarang(barang);
        System.out.println("Method simpan ditekan");
    }

    public Barang getBarang() {
        return barang;
    }

    public void setBarang(Barang barang) {
        this.barang = barang;
    }

    public void save() {
        System.out.println("Method save ditekan");
    }

    @Override
    public String getClientId() {
        return null;
    }

    @Override
    public void setClientId(String string) {
        throw new UnsupportedOperationException("Not supported yet.");
    }

    @Override
    public PropertyChangeObserver getPropertyChangeObserver() {
        throw new UnsupportedOperationException("Not supported yet.");
    }
}
